package com.atqh.srrt.chicken.controller.UserController;

import com.atqh.srrt.chicken.Aop.LogAnnotation;
import com.atqh.srrt.chicken.Vo.params.LoginParam;
import com.atqh.srrt.chicken.service.LoginService;
import com.atqh.srrt.chicken.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@CrossOrigin
public class LoginController {

//    @Autowired
//    private SysUserService sysUserService;
//    不建议,每个Service都有单独的业务

    @Autowired
    private LoginService loginService;

    @RequestMapping
    @LogAnnotation(module = "用户模块",operator = "用户登录")
    public Result login(@RequestBody LoginParam loginParam) {
        //登陆验证用户 访问用户表
        return loginService.login(loginParam);
    }
}

